import Vue from 'vue'
import { requst } from '@/http/request.js'
import { getUInfo, timestampToDateFormat } from '@/util/util.js'

// 获取验证码
Vue.prototype.$getSmsCode = (prms) => {
	return requst('/api/sms/send', prms, 'POST')
}

// 登录 
Vue.prototype.$login = (prms) => {
	return requst('/api/anzhuang/mobilelogin', prms, 'POST', { 'content-type': 'application/x-www-form-urlencoded' })
	// return requst('/api/anzhuang/mobilelogin', prms, 'POST', { 'content-type': 'multipart/form-data' })
}

// 安装列表
Vue.prototype.$getInstallList = (prms) => {
	// prms = { ...prms, token: getUInfo().token }
	return requst('/api/anzhuang/install_list', prms, 'POST', {
		'content-type': 'application/x-www-form-urlencoded',
		'token': getUInfo().token
	})
}

// 安装师傅接单 
Vue.prototype.$receiveOrder = (prms) => {
	return requst('/api/anzhuang/receive', prms, 'POST', {
		'content-type': 'application/x-www-form-urlencoded',
		'token': getUInfo().token
	})
}

// 提交安装信息 
Vue.prototype.$submitInfo = (prms) => {
	return requst('/api/anzhuang/install', prms, 'POST', {
		'content-type': 'application/x-www-form-urlencoded',
		'token': getUInfo().token
	})
}

// 获取评价数据 
Vue.prototype.$getEvaluate = (prms) => {
	return requst('/api/index/huifang', prms, 'GET', {
		'content-type': 'application/x-www-form-urlencoded',
	})
}

// 提交评价数据 
Vue.prototype.$postEvaluate = (prms) => {
	return requst('/api/index/sign', prms, 'POST', {
		'content-type': 'application/x-www-form-urlencoded',
	})
}



// 获取大区   
Vue.prototype.$getAreaList = (prms) => {
	return requst('/api/index/region', prms, 'GET')
}

// 获取网点 /api/index/site?id=1
Vue.prototype.$getSiteList = (prms) => {
	return requst('/api/index/site', prms, 'GET')
}